package br.com.jbssistemas.dirfweb.util;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 *
 * @author Daniel
 * 
 */
public class Util {
   
    public static String dataReversa(Date data){
        return new SimpleDateFormat("yyyy-MM-dd").format(data);
    }
    
    public static String formatarData(Date data){
        return new SimpleDateFormat("dd-MM-yyyy").format(data);
    }
    
    public static Date addDate(Date data, int campo ,int valor){
        Calendar c = Calendar.getInstance();
        c.setTime(data);
        c.add(campo, valor);
        return c.getTime();
    }
    
    public static String pegarMesCorrente(){
        return String.valueOf(Calendar.getInstance().get(Calendar.MONTH)+1);
    }
    
}
